//index.js
const api = require('../../utils/api.js');
const util = require('../../utils/util.js');
const constant = require('../../utils/constant.js');
//获取应用实例
const app = getApp();
Page({
  data: {
    shopName: '新服务',
    productArray: [],
    selectedproduct: '', // 选中商品数组下标
    recordNumber: 1, // 卖出数量
    user: app.globalData.user,
    scoreUserPhone: '', // 积分用户电话
    scoreUserNumber: 0, // 本次积分多少
    measureArray: [], // 所有积分带选项
    selectedMeasureIndex: 0, // 选中的积分项
    usingScore: true, // 为用户使用积分
    usingScoreText: '不为用户使用积分',
      cause: [' 故障 ', ' 报错 ', ' 缺料 ', ' 其他 '],
        causeIndex: [0, 1, 2, 3],
            id: null,
            tasks:[],
wait: [{
      id: 1,
      ptel: '咖啡拿铁',
      ptitle: '客户刘先生',
      pCondition: 5,
      date: '2021-5-6',
      cause:'故障',
      content: "肚子吃坏了",
      phone:12783903
    }, {
      id: 2,
      ptel: '芋泥波波奶茶',
      ptitle: ' 客户张女士 ',
      pCondition: 5,
      date: '2021 - 5 - 6 ',
      cause: '报错',
      content: "牛奶太甜了"
    },
    {
      id: 3,
      ptel: '青稞牛奶',
      ptitle: ' 客户谢女士 ',
      pCondition: 5,
      date: '2021-8-6 ',
       cause: '缺料',
      content: "牛奶过期"
    },
  ],

            onroad: [],
            inhouse:[],
  },
  onLoad: function (options) {

 var that = this

 that.setData({
   //title: options.title ==0 ? '等待阶段':( options.title ==1 ?'在途':'入库'),
   id: options.id - 1,
   showLoading: false,

 })
 if (!that.data.showLoading) {
   that.setData({
     tasks: that.data.wait[that.data.id]
   })
 }

 console.log(that.data.id)


  }
})